import {defineConfig} from 'vite'
import AutoImport from 'unplugin-auto-import/vite'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite'
// https://vitejs.dev/config/
export default defineConfig({

    plugins: [
        vue(),
        AutoImport({
            imports: ['vue', 'vue-router', 'vuex'],

            dirs: ['/auto-imports.d']
        }),],

    server: {
        port: 3000, // 端口号
        host: "0.0.0.0",
        open: true,
        https: false,
        proxy: {
            "/api": {
                // target: "https://192.168.0.46:8080/api",
                // target: "https://43.142.124.118:8080/api",
                // target: "https://iroade-cas.jslurun.cn/api",
                target: "https://dev-api.jslurun.cn/smart-api/api",
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/api/, ""),
            },
        },
    },
})
